/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * RelatorioPedido.java
 *
 * Created on 13/11/2009, 13:55:04
 */

package br.edu.ifrn.gui;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Cliente
 */
public class RelatorioPedido extends javax.swing.JFrame {

    /** Creates new form RelatorioPedido */
    public RelatorioPedido(int m, int a) {
        initComponents();
        setarTitulo(m,a);
    }

    public RelatorioPedido(){
        
    }

    String diaPedido;

    /*private Date data = new Date();
    String formato = "dd/MM/yyyy";
    SimpleDateFormat formatter = new SimpleDateFormat(formato);
    String title = formatter.format(data);*/

    public void setarTitulo(int m,int a){
        Date data = new Date();
        data.setMonth(m);
        data.setYear(a);
        String formato = "MM/yyyy";
        SimpleDateFormat formatter = new SimpleDateFormat(formato);
        String title = formatter.format(data);
        this.setTitle("Relatorio do dia " + title);
    }
    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        scrollPane = new javax.swing.JScrollPane();
        relatorios = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Relatorio do dia " + diaPedido);
        setResizable(false);

        relatorios.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null}
            },
            new String [] {
                "Quantidade de CDs vendidos", "Gastos totais", "Saldo final"
            }
        ));
        scrollPane.setViewportView(relatorios);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(scrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 465, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(scrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTable relatorios;
    private javax.swing.JScrollPane scrollPane;
    // End of variables declaration//GEN-END:variables

}
